﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;

namespace BHair.Report
{
    public partial class Frmtizhong : Form
    {
        public Frmtizhong()
        {
            InitializeComponent();
        }
         public static string cardid;
        string constr = ConfigurationManager.ConnectionStrings["BHair.Properties.Settings.BHairDBConnectionString"].ConnectionString;
        private void Frmtizhong_Load(object sender, EventArgs e)
        {
            cx();
        }
        public void cx()
        {
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();
            string sql = string.Format(" SELECT[id] as ID ,[djbh] as 单据号 ,[xmname] as 项目   ,[xfcs] as 消费次数  ,[riqi] as 日期 ,[cardid] as 卡号  ,[bz] as 体重  FROM [jcxf]  where cardid = '{0}'",chuanzhi.tzcardid);
            SqlDataAdapter sda = new SqlDataAdapter(sql,conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            dataGridView1.DataSource = dt;
            conn.Close();
           
     
     
    
     
     
    
       
        }

    }
}
